import com.google.gdata.data.youtube.VideoEntry;
import com.google.gdata.data.youtube.YouTubeMediaGroup;

public class YouTubeFeedEntry {
	private String id;
	private String title;
	private Long duration;
	private int views;
	private String thumbnail;
	
	public YouTubeFeedEntry(VideoEntry video) {
		YouTubeMediaGroup vidGroup = video.getMediaGroup();
		
		this.id = vidGroup.getVideoId();
		this.title = vidGroup.getTitle().getPlainTextContent();
		this.duration = vidGroup.getDuration();
		this.views = 0;
		this.thumbnail = vidGroup.getThumbnails().get(0).getUrl();
	}

	public String getID() {
		return id;
	}
	
	public void setID(String id) {
		this.id = id;
	}
	
	public String getName() {
		return title;
	}

	public void setName(String name) {
		this.title = name;
	}

	public Long getDuration() {
		return duration;
	}

	public void setDuration(Long duration) {
		this.duration = duration;
	}

	public int getViews() {
		return views;
	}

	public void setViews(int views) {
		this.views = views;
	}

	public String getImageLink() {
		return thumbnail;
	}

	public void setImageLink(String imageLink) {
		this.thumbnail = imageLink;
	}

	@Override
	public String toString() {
		return "YouTubeFeedEntry [id=" + id + ", name=" + title + ", duration=" + duration
				+ ", views=" + views + ", thumbnail=" + thumbnail + "]";
	}
	
	
}